package hmis.pos.Repository;


import hmis.pos.Base.BaseRepository.BaseRepository;
import hmis.pos.Entity.RoomMessage;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface RoomMessageRepository extends BaseRepository<RoomMessage> {

    @Query(value = "select * from roommessage where type = ?1", nativeQuery = true)
    List<RoomMessage> findByType(String type);

    @Query(value = "select * from roommessage where roomid = ?1", nativeQuery = true)
    RoomMessage findByRoomid(int roomid);

    int countByType(String type);
}
